package com.suxiaoxiao.springbootlearn;

import com.suxiaoxiao.springbootlearn.configuration.ConfigurationDemo;
import com.suxiaoxiao.springbootlearn.java.spi.SpiDemoInterface;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.ServiceLoader;
import java.util.stream.Stream;

public class MainApp {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(ConfigurationDemo.class);
        String[] beanDefinitionName = ctx.getBeanDefinitionNames();
        Stream.of(beanDefinitionName).forEach(System.out::println);
        /**
         * 输出结果为
         * configurationDemo
         * currentDate
         * 两个类都被加载进来了
         */
    }

}
